package com.azzcs.elasticsearch.controller;

import com.azzcs.elasticsearch.service.PositionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.io.IOException;
import java.util.List;
import java.util.Map;

/**
 * @Author: wzg
 * @Date: 2021/5/14 下午5:39
 */
@RestController
@RequestMapping("position")
public class PositionController {
    @Autowired
    private PositionService positionService;

    @GetMapping("search")
    public List<Map<String,Object>> search(@RequestParam String keyword,
                                           @RequestParam(defaultValue = "1") int pageNum,
                                           @RequestParam(defaultValue = "5") int pageSize) throws IOException {
        return positionService.search(keyword,pageNum,pageSize);
    }

}
